home *** CD-ROM | disk | FTP | other *** search
- /*
-
- GetUnique 1.1 (10.3.95) was written by Thomas Esser.
-
- - DISCLAIMER -
-
- GetUnique is Copyright (c) 1995 Thomas Esser, but you may freely
- use it and pass any number of copies to your friends, as long as you
- don't charge anyone for giving him/her a copy. You are NOT allowed
- to modify the distribution archive which may only be copied complete
- and intact. The archive MUST contain the following files:
-
- GetUnique - 200 Bytes
- GetUnique.c - 1810 Bytes
- SCOPTIONS - 316 Bytes
-
- YOU AGREE TO USE THIS PROGRAM ENTIRELY AT YOUR OWN RISK! I CAN'T BE
- HELD RESPONSIBLE FOR DAMAGE WHATSOEVER RESULTING FROM USING THIS
- PROGRAM!
-
-
- - PURPOSE -
-
- GetUnique must be called from CLI only! It returns a number, which
- will be unique. I use this for generating Filenames who must be
- definitly unique, e.g. in Shell or Rexxscripts. In the shell you
- can use it via the backtick (`) characters:
-
- move foo foo.`getunique`
-
- GetUnique need Kickstart V39 - 3.0 or better.
-
-
- - RECOMPILING -
-
- I use V6.55 of the SAS/C Compiler and the SCOPTIONS File.
-
-
- - THANKS GOES TO -
-
- Ralph 'Zodiac' Seichter, for tips & tricks, sources and many really
- useful programs and last not least - the Backtickstrick :).
-
- SAS, for this great compiler.
-
-
- - CONTACT ME -
-
- Thomas Esser
- T.v. Wuellenweberstr. 28
- D-50169 Kerpen
-
- Phone: (49)2273 910061Q
-
- EMail: t.esser@darness.gun.de
-
- */
-
- LONG getunique (VOID);
-
- const static char __ver[] = "$VER: GetUnique 1.1 " __AMIGADATE__;
-
- LONG __saveds getunique (VOID)
- {
- struct Library *DOSBase;
- struct Library *UtilityBase;
- LONG rc = RETURN_FAIL;
-
- if (DOSBase = OpenLibrary (DOSNAME, 39))
- {
- {
- UtilityBase=OpenLibrary (UTILITYNAME, 39);
- Printf("%lu",GetUniqueID());
- CloseLibrary (UtilityBase);
-
- rc = RETURN_OK;
- }
- CloseLibrary (DOSBase);
- }
- return (rc);
- }
-